<!doctype html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>微信支付</title>
    <script type="text/javascript">
        //调用微信JS api 支付
        function jsApiCall() {

            WeixinJSBridge.invoke(
                'getBrandWCPayRequest',
                <?php echo json_encode($jsApiParameters); ?>,
                function(res) {
                    WeixinJSBridge.log(res.err_msg);
                    var type = '';
                    if (res.err_msg == 'get_brand_wcpay_request:ok') {
                        type = 'success';
                        alert('支付成功');
                    } else {
                        type = 'error';
                        alert('支付失败');
                    }
                    window.location.href = "{{$return_url}}&type=" + type;
                }
            );
        }

        function callpay() {
            if (typeof WeixinJSBridge == "undefined") {
                if (document.addEventListener) {
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                } else if (document.attachEvent) {
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            } else {
                jsApiCall();
            }
        }
        callpay();
    </script>
</head>

<body>
    <br />
    <!-- <font color="#9ACD32"><b>该笔订单支付金额为<span style="color:#f00;font-size:50px">元</span>钱</b></font><br/><br/> -->
    <!-- <div align="center">
            <button style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" >正在支付</button>
        </div> -->
</body>

</html>